package cn.iocoder.ny.module.mall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 商品分类
 */
@Data
@TableName(value = "mall_product_category")
public class MallProductCategory {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 分类名称
     */
    @NotBlank(message = "分类名称不允许为空",groups = {Add.class,Edit.class})
    @TableField(value = "`name`")
    private String name;

    /**
     * 父级分类id （顶级默认为0）
     */
    @TableField(value = "parent_id")
    private Integer parentId;

    /**
     * 排序
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 是否显示  0：false  1:true
     */
    @TableField(value = "is_show")
    private Integer isShow;


    /**
     * 租户Id
     */
    @TableField(value = "tenant_id")
    private Long tenantId;


    @TableField(value = "del_flag")
    private Integer delFlag;

    @TableField(value = "create_by")
    private String createBy;

    @TableField(value = "create_time")
    private Date createTime;

    @TableField(value = "update_by")
    private String updateBy;

    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(value = "remark")
    private String remark;


    public interface Add{}
    public interface Edit{}

}